//返回首页
$('.btn-back').on('click', function() {
    $(this).attr('href', '../index.html');
})

//返回顶部
$('.footer_top .back').on('click', function() {
    var timeId = setInterval(function() {
        var target = 0;
        var leader = scroll().scrollTop;
        leader = leader + (target - leader) / 10;
        scrollTo(0, leader);
        if (leader == target) {
            clearInterval(timeId);
        }
    })
})

function scroll() {
    return {
        scrollTop: window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,
        scrollLeft: window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0,
    }
}